package lambda;

import java.util.function.Function;

public class StaticMethodReference {
    public static void main(String[] args) {
        // 转化函数式接口
        Function<Double,Long> function1 = new Function<Double, Long>() {
            @Override
            public Long apply(Double aDouble) {
                return Math.round(aDouble);
            }
        };
        System.out.println(function1.apply(3.14));

        Function<Double,Long> function2 = d -> Math.round(d);
        System.out.println(function2.apply(6.28));

        Function<Double,Long> function3 = Math::round;
        System.out.println(function3.apply(9.56));

    }
}
